package com.hopu.springmvc.controller;

import com.hopu.springmvc.entity.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@Controller
@RequestMapping("test")
public class TestController {

    @ResponseBody
    @RequestMapping("test1")
    public String test(){
        return "index";
    }

    @CrossOrigin
    @ResponseBody
    @RequestMapping("test2")
    public User test2(){
        return new User("hello","world","hello world",33);
    }
}
